//
//  ProgressView.m
//  WGFGlobalHouses
//
//  Created by welldone on 15/5/5.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "ProgressView.h"
#import "config.h"


@interface ProgressView ()

@property (weak, nonatomic) IBOutlet UIImageView *icon1;
@property (weak, nonatomic) IBOutlet UILabel *line1;
@property (weak, nonatomic) IBOutlet UIImageView *lcon2;
@property (weak, nonatomic) IBOutlet UILabel *line2;

@property (weak, nonatomic) IBOutlet UIImageView *icon3;
@property (weak, nonatomic) IBOutlet UILabel *line3;
@property (weak, nonatomic) IBOutlet UIImageView *icon4;
@property (weak, nonatomic) IBOutlet UILabel *line4;
@property (weak, nonatomic) IBOutlet UIImageView *lcon5;
@property (weak, nonatomic) IBOutlet UILabel *line5;
@property (weak, nonatomic) IBOutlet UIImageView *icon6;


@property (weak, nonatomic) IBOutlet UILabel *lable1;
@property (weak, nonatomic) IBOutlet UILabel *lable2;
@property (weak, nonatomic) IBOutlet UILabel *lable3;
@property (weak, nonatomic) IBOutlet UILabel *lable4;
@property (weak, nonatomic) IBOutlet UILabel *lable5;
@property (weak, nonatomic) IBOutlet UILabel *lable6;

@property (weak, nonatomic) IBOutlet UILabel *stateLab;



@end


@implementation ProgressView


+(ProgressView*)creatView{
    
    ProgressView *view = [[[NSBundle mainBundle]loadNibNamed:@"ProgressView" owner:nil options:nil]lastObject];
    
    return  view;
}



/* old
-(void)setPogressState:(Progress)state{

    switch (state) {
    
        case Progress1:
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_b_1"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_a_2"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_a_3"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_a_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            break;
            
        case Progress2:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_b_2"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_a_3"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_a_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            break;
            
        case Progress3:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_b_3"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_a_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
        
            
            break;
            
        case Progress4:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_b_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            
            break;
            
        case Progress5:
            
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];

            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_b_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            break;
            
        case Progress6:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xf44047)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            
            break;
            
        default:
            break;
    }
}
*/


-(void)setPogressState:(Progress)state{
    
    
     [self.stateLab setHidden:true];
    
    switch (state) {
            
        case Progress1:
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_b_2"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_a_3"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_a_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            break;
            
        case Progress2:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            
            [self.line3 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_b_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            break;
            
        case Progress3:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            
            [self.line3 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            
            [self.line4 setBackgroundColor:UIColorFromRGB(0xdedede)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_b_4"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_a_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            
            break;
            
        case Progress4:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0xdedede)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_b_5"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_a_6"]];
            
            
            break;
            
        case Progress5:
            
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_b_6"]];
            
            break;
            
        case Progress6:
            
            [self.line1 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line2 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line3 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line4 setBackgroundColor:UIColorFromRGB(0xf44047)];
            [self.line5 setBackgroundColor:UIColorFromRGB(0x91ca5e)];
            
            [self.icon1 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon2 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon3 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon4 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.lcon5 setImage:[UIImage imageNamed:@"user_order_lc_c"]];
            [self.icon6 setImage:[UIImage imageNamed:@"user_order_lc_b_6"]];
            
            break;
            
        case Progress7:

            
            [self.stateLab setHidden:false];
            [self.stateLab setText:@"订单完成"];
            
            break;
            
            
        case Progress8:
            
            [self.stateLab setHidden:false];
            [self.stateLab setText:@"订单待退款"];
            
            break;
            
        case Progress9:
            
            [self.stateLab setHidden:false];
            [self.stateLab setText:@"订单关闭"];
            break;

            
        default:
            break;
    }
}



@end
